﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using DataService.Core.Network;
using Org.BouncyCastle.Utilities;

namespace UnitTest
{
    public static class TestNetwork
    {
        public static void TestAddressInfo()
        {
            IPAddress iPAddress= NetHelper.MyIP4();
            Console.WriteLine($"IPV4地址：{iPAddress.ToString()}***{iPAddress.GetAddress()}");

            Console.WriteLine(BitConverter.ToString(NetHelper.GetMac()));
            foreach (var item in NetHelper.GetDns())
            {
                Console.WriteLine($"DNS:{item.ToString()}");
            }

            foreach (var item in NetHelper.GetIPs())
            {
                Console.WriteLine($"IP:{item.ToString()}");
            }

            foreach (var item in NetHelper.GetMacs())
            {
                string macAddress = BitConverter.ToString(item).Replace("-", ":");
                Console.WriteLine($"网卡MAC地址:{macAddress}");
            }
        }
    }
}
